home *** CD-ROM | disk | FTP | other *** search
/ USGS: Oil & Gas Fields of Asia Pacific / USGS Maps Showing Geology, Oil & Gas Fields of Asia Pacific.iso / pc / ASPAC / VIEWPC03 / SCRIPTS / ZMINBUT.AVE < prev    next >
Text File  |  1999-03-10  |  3KB  |  102 lines

  1. ' zminbut.ave
  2. ' Douglas Steinshouer   11/28/1998
  3. ' GeoLukas for USGS 
  4. ' World Energy Program
  5. ' Modifies the ViewZoomIn button
  6. ' to label geologic age on the fly
  7.  
  8. region3 = av.GetProject
  9. theView = av.GetActiveDoc
  10.  
  11. '  Filters out Legend
  12.  
  13. leg = region3.FindDoc("Geologic Legend")
  14.  
  15.  
  16.  if (theView = leg) then
  17.   region3.SetModified(true)
  18.   
  19.   theView.GetDisplay.ZoomIn(125)
  20.  
  21.  else 
  22.   av.ShowMsg("Labeling geologic age ...")
  23.   av.ShowStopButton
  24.   av.SetStatus(0)
  25.   
  26.   region3.SetModified(true)
  27.   theView.GetDisplay.ZoomIn(125)
  28.   
  29.    ' Defines the theme and clears labels
  30.   
  31.   theTheme = theView.GetThemes.Get(5)
  32.   theTheme.SetActive(true)
  33.   theTheme.GetGraphics.SelectLabels
  34.   theTheme.GetGraphics.Invalidate
  35.   theView.GetGraphics.ClearSelected
  36.  
  37.    ' Determines the scale of zoomed view
  38.  
  39.    size = theView.GetDisplay.ReturnVisExtent
  40.    tall = size.GetHeight
  41.    long = size.GetWidth
  42.  
  43.     ' Filters scale and draws labels
  44.  
  45.      if ((tall < 889000) AND (long < 1227670)) then
  46.        agelabel = Labeler.Make(size)
  47.        agelabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  48.        agelabel.SetLabelWeight(#LABEL_WEIGHT_LOW)
  49.        agesymbol = TextSymbol.Make
  50.        agesymbol.SetFont(Font.Make("Univers","Medium"))
  51.         if ((tall < 44450) AND (long < 61383)) then
  52.           agesymbol.SetSize(15)
  53.         elseif ((tall < 88900) AND (long < 122767)) then
  54.           agesymbol.SetSize(12)
  55.         elseif ((tall < 222250) AND (long < 306917)) then
  56.           agesymbol.SetSize(11)
  57.         elseif ((tall < 444500) AND (long < 613835)) then
  58.           agesymbol.SetSize(10)
  59.         elseif ((tall < 666751) AND (long < 920752)) then
  60.           agesymbol.SetSize(9)
  61.        else
  62.     agesymbol.SetSize(8)
  63.        end
  64.      theTheme.SetLabelTextSym(agesymbol)
  65.      agelabel.Load(theTheme)
  66.      theView.GetAutoLabels(agelabel,true)
  67.     else
  68.      theTheme.GetGraphics.SelectLabels
  69.      theTheme.GetGraphics.Invalidate
  70.      theView.GetGraphics.ClearSelected
  71.     end
  72.     
  73.     t2 = theView.GetThemes.Get(0)
  74.     t2.SetActive(true)
  75.     t2.GetGraphics.SelectLabels
  76.     t2.GetGraphics.Invalidate
  77.     theView.GetGraphics.ClearSelected
  78.  
  79.     citylabel = Labeler.Make(size)
  80.     citylabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  81.     citylabel.SetLabelWeight(#LABEL_WEIGHT_HIGH)    
  82.     citysymbol = TextSymbol.Make
  83.     citysymbol.SetFont(Font.Make("Univers","Italic"))
  84.     citysymbol.SetSize(10)
  85.     t2.SetLabelTextSym(citysymbol)
  86.     citylabel.Load(t2)
  87.     theView.GetAutoLabels(citylabel,true)
  88.  
  89.     ts = theView.GetThemes
  90.       for each t in ts
  91.         t.SetActive(false)
  92.       end
  93.  
  94.  
  95. av.SetStatus(100)
  96. av.ClearMsg
  97.  
  98.    end
  99.  
  100.         
  101.  
  102.